package com.tqz.rc.spring.cloud.discovery;

import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <p>
 *
 * @author tianqingzhao
 * @since 2021/9/3 15:55
 */
@Configuration
@AutoConfigureAfter(TqzRcDiscoveryAutoConfiguration.class)
public class TqzRcDiscoveryClientConfiguration {

    @Bean
    @ConditionalOnBean(TqzRcServiceDiscovery.class)
    public DiscoveryClient tqzRcDiscoveryClient(TqzRcServiceDiscovery tqzRcServiceDiscovery) {
        return new TqzRcDiscoveryClient(tqzRcServiceDiscovery);
    }
}
